import java.util.Scanner;
import java.time.LocalDate;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            LocalDate start = LocalDate.of(sc.nextInt(),sc.nextInt(),sc.nextInt());
            LocalDate end = LocalDate.of(sc.nextInt(),sc.nextInt(),sc.nextInt());
            int money = 0;
            while(start.compareTo(end)<=0){
                int month = start.getMonthValue();
                if(month==2||month==3||month==5||month==7||month==11){
                    money+=1;
                }else{
                    money+=2;
                }
                start=start.plusDays(1);
            }
            System.out.println(money);
        }
    }
}